<template>
  <van-nav-bar
    :title="title"
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
    class="nav_bar"
  />
</template>

<script>
import { useRouter } from "vue-router";
import { defineComponent } from "vue";
export default defineComponent({
  name: "CNavBar",
  props: {
    title: {
      type: String,
    },
  },
  setup(props, contxt) {
    const router = useRouter();
    const onClickLeft = () => {
      router.go(-1);
    };
    return {
      onClickLeft,
    };
  },
});
</script>

<style lang="scss" scoped>
.nav_bar {
  width: 100%;
  position: fixed;
}
</style>
